package com.by.goods.feign;


import com.by.api.dto.CarDto;
import com.by.common.core.bean.ResultBean;
import com.by.common.core.response.R;
import com.by.feign.client.SkuRemoteClient;
import com.by.feign.dto.SkuDto;
import com.by.goods.service.SkuService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Tag(name = "sku",description = "sku远程调用接口")
public class SkuFeignController implements SkuRemoteClient {

    @Autowired
    SkuService skuService;

    @Override
    public ResultBean<SkuDto> querySku(int id) {
        SkuDto skuDto=skuService.querySku(id);
        return R.success("sku信息",skuDto);
    }


    @Override
    public ResultBean lockSkuStock(List<CarDto> carDtoList) {
        int rs=skuService.lockSkuStock(carDtoList);
        return R.success("锁定库存",rs);
    }
}
